<meta charset="utf-8">
<div class="box box-primary" id="pmpBugs_add">
	<form role="form" id="pmpBugs_add_editForm">
		<div class="box-body">
		
		
		<div class="row">
				<div class="col-md-12">
				<div class="form-group">
						<label for="title">BUG名称</label> 
						<input type="text" name="bugName" v-model="pmpBugs.bugName" class="form-control" id="bugName" required />
					</div>
				</div>
			</div>
		
		
			<div class="row">
				<div class="col-md-8">
					<div class="form-group">
							<label for="title">BUG责任人</label> 
							<select type="text" name="chargeUserId" class="form-control" id="chargeUserId" v-model="pmpBugs.chargeUserId"
								v-kselect="{url:'/pmp/service/pub/pmpProject/loadProjectGroupComboboVo',ajaxKey:'projectId',vmodel:'pmpBugs.chargeUserId',firstEmpty:'true'}">
							</select>
					</div>
				</div>
				<div class="col-md-4">
					<div class="form-group">
						<label for="title">截止时间</label>  
						<input type='text' class="form-control date form_datetime" id="expiryTime" v-kmdatetime="{vmodel:'pmpBugs.expiryTime',format:'yyyy-MM-dd hh:mm:ss'}" v-model="pmpBugs.expiryTime" /> 
                   </div>
						
				</div>
			</div>
			

		
			<div class="row">
				<div class="col-md-8">
					<div class="form-group">
							<label for="title">BUG指派</label> 
							<select type="text" name="assignUserId" class="form-control" id="assignUserId" v-model="pmpBugs.assignUserId"
								v-kselect="{url:'/pmp/service/pub/pmpProject/loadProjectGroupComboboVo',ajaxKey:'projectId',vmodel:'pmpBugs.assignUserId',firstEmpty:'true'}">
							</select>
					</div>
				</div>
				<div class="col-md-4">
					<div class="form-group">
					
						<label for="title"> BUG优先级</label>
						<select v-model="pmpBugs.priority" id="priority" name="priority" class="form-control" required>
							<option value="1">低</option>
							<option value="2">中</option>
							<option value="3">高</option>
							<option value="4">急</option>
							<option value="5">加急</option>
						</select>
						
					
                   </div>
						
				</div>
			</div>
			
				
			<div class="row">
				<div class="col-md-8">
					<div class="form-group">
							<label for="title">评估时间（小时）</label> 
							<input type="number"  name="assignHours" v-model="pmpBugs.assignHours" class="form-control" id="assignHours"/>
						</div>
				</div>
				<div class="col-md-4">
						 <div class="form-group">
							<label for="title">难度系数</label>
							 <select id="difficultyScoreId" name="difficultyScoreId" v-model="pmpBugs.difficultyScoreId" class=" form-control"
								v-kselect="{url:'/pmp/service/pub/pmpALine/loadDifScoreComboboVo',vmodel:'pmpBugs.difficultyScoreId',firstEmpty:'true'}">
							</select>
						</div>
				</div>
			
			</div>
				   
				<div class="row">
				<div class="col-md-8">
					<div class="form-group">
						<label for="title">扣分标准</label>  
						 <select id="deduceId" name="deduceId" v-model="pmpBugs.deduceId" class=" form-control"
								v-kselect="{url:'/pmp/service/pub/pmpALine/loadDeduceLineComboboVo',ajaxKey:'projectId',vmodel:'pmpBugs.deduceId',firstEmpty:'true'}">
							</select>
					</div>
				</div>
				<div class="col-md-4">
									<div class="form-group">
										<label>项目版本</label> 
										<select type="text"
											name="projectVersionId" v-model="pmpBugs.projectVersionId"
											v-kselect="{url:'/pmp/service/pub/pmpProjectVersion/loadVersionComoboVo',ajaxKey:'projectId',vmodel:'pmpBugs.projectVersionId',firstEmpty:'true'}"
											class="form-control" id="chargeUserId">
										</select>
									</div>
				</div>
			
			</div>	   
				   
			<div class="row">
				<div class="col-md-8">
					<div class="form-group">
						<label>严重程度</label> 
						<select id="severity" name="severity" v-model="pmpBugs.severity" class=" form-control" required>
							<option value="1">轻微</option>
							<option value="2">小调整</option>
							<option value="3">中等</option>
							<option value="4">严重</option>
							<option value="5">非常严重</option>
							<option value="6">宕机</option>
						</select>
					</div>
				</div>
				<div class="col-md-4">
									<div class="form-group">
										<label>出现频率</label> 
										<select id="frequency" name="frequency" v-model="pmpBugs.frequency" class=" form-control" required>
											<option value="1">随机</option>
											<option value="2">总是</option>
										</select>
									</div>
				</div>
			
			</div>
					
				   <div class="form-group">
					<label for="title">BUG详情</label>
					<textarea rows="5" cols="" name="bugDetail" v-model="pmpBugs.bugDetail" class="form-control" id="bugDetail" required>
					</textarea>
				</div>
				
			
     </div><!-- /.box-body -->
     
     <div class="box-footer">
	        <button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
	        <button type="button" class="btn btn-info pull-right" v-on:click="add">提交</button>
     </div>
   
   </form>
</div>

<script type="text/javascript">

	var news = new Vue({
		el : '#pmpBugs_add',
		data : {
			 projectId: project_detail_main.$data.projectId,
			pmpBugs : {
				projectId : project_detail_main.$data.projectId,
				projectVersionId : null,
				bugName : null,
				bugDetail : null,
				fromRequire : 0,
				requireId : null,
				chargeUserId : null,
				assignUserId: null,
				assignHours : null,
				difficultyScoreId : null,
				deduceId: null,
				priority : null,
				severity: null,
				frequency:  null,
				expiryTime : null,
				bugFrom: 4
			},
			bus : new Vue(),
		},
		mounted : function() {
			var _this = this;
			_this.pmpBugs.projectId=_this.projectId;
		},
		methods : {
			add : function() {
				var _this = this;
				if ($("#pmpBugs_add_editForm").valid()) {
					let _this = this;
					let url = "/pmp/service/test/pmpBugs/createPmpBugs";
					zfesAjax.ajaxTodo(url, _this.$data.pmpBugs,
							function(data) {
								alertSwal.successText(data.message);
								layer.close(layer.index);
							})
				}
			},
			cancle : function() {
				layer.close(layer.index);
			}
			
			
		}
	});
</script>

